source_log <- function(
    script,
    script_location = "scripts/",
    log_location = "logs/",
    append = FALSE
) {
  log_file <- paste0(log_location, gsub("\\.R", "\\.log", script))
  script_file <- paste0(script_location, script)
  sink(log_file, append = append)
  source(script_file,
         echo = TRUE,
         max.deparse.length = 1e5)
  sink()
}